package com.qfedu.controller;

import com.qfedu.entity.Rank;
import com.qfedu.entity.ResponseData;
import com.qfedu.service.RankService;
import com.qfedu.service.SongListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RankController {

    @Autowired
    private RankService rankService;

    /**
     * 获取指定歌单的评分
     * @param songListId
     * @return
     */
    @RequestMapping("/rank")
    public Integer getRankOfSongListId(int songListId) {
        return rankService.getRankOfSongListId(songListId);
    }

    /**
     * 提交评分
     * @param rank
     * @return
     */
    @RequestMapping("/rank/add")
    public ResponseData<String> setRank(Rank rank){

        return rankService.setRank(rank);
    }
}
